package com.pc.web.goods;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository	
public class GoodsDao {
	//관리자 상품 등록
	@Autowired private SqlSession sql;
	public void insert(GoodsBeans bean) {	
			sql.insert("goods.form", bean);
	}
	//상품list
	public List<GoodsBeans> list() {	
		return sql.selectList("goods.list");
	}
	
	//상품상세 보기
	public GoodsBeans detail(String goods_code) {
		return	sql.selectOne("goods.detail",goods_code);
		
	}
	//관리자 상품 수정페이지
	public GoodsBeans updateForm(String goods_code) {
		return	sql.selectOne("goods.updateForm", goods_code);
		
	}
	//관리자 상품 수정
	public void update(GoodsBeans beans){
		sql.update("goods.update", beans);	
	}
	//관리자 상품삭제
	public void delete(GoodsBeans beans) {
		 sql.delete("goods.delete", beans);
	
		
	}
}